const http = require('http')
const url = require('url')
const serve = http.createServer((request,response) => { 
   // request.url 可以直接获取到请求链接的url
    // 1.获取url
    const {pathname,query} = url.parse(request.url,true)  //(选填)true表示将query转换成对象
    console.log(pathname,query)
   response.end('hello world')

 })
 serve.listen(3000,() => {
    console.log('服务启动成功...')
 })